import React, { useState } from 'react';
import MyTitle from '../../../component/System settings/MyTitle'
import MyFormbox from '../../../component/System settings/MyFormbox'
import { message } from 'antd';
import { useNavigate } from 'react-router-dom';
import { manager_add } from '../../../utils/System settings/api'

interface Props {

}
function Addadmin(props: Props) {
    let navigate = useNavigate()
    // 保存
    const onFinish = (values: any) => {
        console.log('newvalues', values)
        manager_add(values).then((res) => {
            message.success('添加成功！')
            console.log(res.data)
            navigate('/index/systemsettings/administrator')
        })
    };


    return (
        <div>
            <MyTitle title={'新增管理员'} />
            <MyFormbox fromtitle={'编辑管理员信息'} onFinish={onFinish}  >
            </MyFormbox>
        </div>
    );
}

export default Addadmin;